﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="TaskScheduler.aspx.cs" Inherits="System_TaskScheduler" Title="Task Scheduler" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <style type="text/css">
        .item
        {
            background-color: #EFF3FB;
        }
        .item2
        {
            background-color: White;
            color: #284775;
        }
        thead > tr
        {
            background-color: #5D7B9D;
            font-weight: bold;
            color: White;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="content" runat="Server">
    <asp:ListView ID="lvTasks" runat="server">
        <LayoutTemplate>
            <table style="width: 100%" cellspacing="0">
                <thead>
                    <tr>
                        <td>
                            Name
                        </td>
                        <td>
                            Status
                        </td>
                        <td>
                            Last run
                        </td>
                        <td>
                            Exit code
                        </td>
                        <td>
                            Account
                        </td>
                    </tr>
                </thead>
                <tbody>
                    <tr id="itemPlaceholder" runat="server" />
                </tbody>
            </table>
        </LayoutTemplate>
        <ItemTemplate>
            <tr class="item">
                <td>
                    <%#Eval("Name") %>
                </td>
                <td>
                    <%#Eval("Status") %>
                </td>
                <td>
                    <%#GetLastRun(Container.DataItem) %>
                </td>
                <td>
                    <%#Eval("ExitCode","0x{0:X}") %>
                </td>
                <td>
                    <%#GetAccount(Container.DataItem) %>
                </td>
            </tr>
        </ItemTemplate>
        <AlternatingItemTemplate>
            <tr class="item2">
                <td>
                    <%#Eval("Name") %>
                </td>
                <td>
                    <%#Eval("Status") %>
                </td>
                <td>
                    <%#GetLastRun(Container.DataItem) %>
                </td>
                <td>
                    <%#Eval("ExitCode","0x{0:X}") %>
                </td>
                <td>
                    <%#GetAccount(Container.DataItem) %>
                </td>
            </tr>
        </AlternatingItemTemplate>
        <EmptyDataTemplate>
            <div class="item2" style="font-style: italic; text-align: center">
                    No scheduled tasks
            </div>
        </EmptyDataTemplate>
    </asp:ListView>
</asp:Content>
